-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve precompilation coverage #33006
Conversation
- move the place where --trace-compile outputs precompile statement to a location that catches more cases - tweak the REPL code to be more amenable to precompilation in light of - instead of trying to encode all the rules where the precompile emitter fails (#28808) just try to precompile and do nothing if it fails.
Just wondering: could this also explain JuliaLang/PackageCompiler.jl#188, which came up after PackageCompiler switched from using SnoopCompile to directly using |
I guess it could, yeah. |
Barring comments, I plan to merge this in a day or so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable to me; mostly it's just code movement.
It seems sensible to consolidate all precompile / snoop compile printing together. I don't know the correct location for that but your tests look good.
@error "Failed to precompile $statement" | ||
rethrow() | ||
# See #28808 | ||
# @error "Failed to precompile $statement" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be left in at @debug
level?
@@ -765,15 +765,21 @@ setup_interface( | |||
repl::LineEditREPL; | |||
# those keyword arguments may be deprecated eventually in favor of the Options mechanism | |||
hascolor::Bool = repl.options.hascolor, | |||
extra_repl_keymap::Union{Dict,Vector{<:Dict}} = repl.options.extra_keymap | |||
extra_repl_keymap::Any = repl.options.extra_keymap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nospecialize
? Just asserting that it's an Any
doesn't prevent the compiler from trying to specialize it. Same for the one below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this takes care of that:
Line 50 in 5e75cfe
@nospecialize # use only declared type signatures |
- move the place where --trace-compile outputs precompile statement to a location that catches more cases - tweak the REPL code to be more amenable to precompilation in light of - instead of trying to encode all the rules where the precompile emitter fails (#28808) just try to precompile and do nothing if it fails. (cherry picked from commit c0478d8)
- move the place where --trace-compile outputs precompile statement to a location that catches more cases - tweak the REPL code to be more amenable to precompilation in light of - instead of trying to encode all the rules where the precompile emitter fails (#28808) just try to precompile and do nothing if it fails. (cherry picked from commit c0478d8)
--trace-compile
outputs precompile statement to a location that catches more cases (it now sits next to where SnoopCompile outputs statements)fails (Precompile statement emitter sometimes emits invalid statements #28808) just try to precompile and do nothing if it fails.
With this, startup time is back to normal and the time to prompt (measured with the patch in #32971 (comment)) is significantly improved, although not yet completely back to 1.1 levels:
1.1
1.2
PR
Probably good enough to say that it fixes #32971 after being backported